package com.cenxi.config;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.cenxi.dao.domain.ExcelDomain;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;

import java.util.ArrayList;
import java.util.List;

@Slf4j
public class MemberExcelListener extends AnalysisEventListener<ExcelDomain> {
	List<ExcelDomain> list = new ArrayList<>();
	@Override
	public void invoke(ExcelDomain t, AnalysisContext analysisContext) {
		list.add(t);
	}

	@Override
	public void doAfterAllAnalysed(AnalysisContext analysisContext) {
		list.forEach(System.out::println);
		list.clear();
		log.info("读取Excel完毕");
	}

}
